#pragma once

#include "Animation/AnimInstance.h"
#include "Camera/CameraComponent.h"
#include "Components/CapsuleComponent.h"
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"

#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "InputActionValue.h"

#include "Study/Lib/Lib.h"
#include "Study/Lib/Static.h"
#include "Study/UI/MainHUD.h"
#include "Study/Prop/Incense.h"
#include "Study/UI/PickTribute.h"
#include "Study/GamePlay/TributeSubsystem.h"
#include "Study/GamePlay/PrimaryGameInstance.h"


#include "MainCharacter.generated.h"

UCLASS(config=Game)
class AMainCharacter : public ACharacter
{
	GENERATED_BODY()


public:
	AMainCharacter();

	virtual void BeginPlay();

	virtual void Tick(float DeltaSeconds) override;

	UMainHUD* GetHUD() {
		return HUD;
	}

	void SetCouldOpenPickTribute(bool bVal) {
		bCouldOpenPickTribute = bVal;
	}

protected:

	bool bCouldOpenPickTribute = false;

	UPROPERTY(VisibleAnywhere)
	ULib* Lib;

	UPROPERTY(VisibleAnywhere)
	UPrimaryGameInstance* PrimaryGameInstance;

	UPROPERTY(VisibleAnywhere)
	UMainHUD* HUD;

	/** MappingContext */
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UInputMappingContext* DefaultMappingContext;

	/** Jump Input Action */
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UInputAction* JumpAction;

	/** Move Input Action */
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UInputAction* MoveAction;

	/** Look Input Action */
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UInputAction* LookAction;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UInputAction* EAction;

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	UInputAction* FAction;

	/** First person camera */
	UPROPERTY(EditAnywhere)
	UCameraComponent* CameraComponent;

	UPROPERTY(EditAnywhere)
	ATribute* Tribute;


	/** Called for movement input */
	void Move(const FInputActionValue& Value);

	/** Called for looking input */
	void Look(const FInputActionValue& Value);

	// APawn interface
	virtual void SetupPlayerInputComponent(UInputComponent* InputComponent) override;
	
	void PressE();

	void PressF();
};

